<template>
  <van-popup v-model:show="showPopup" closeable round>
    <div class="face-popup">
      <img src="@/assets/img/head.png" alt="" />
      <span class="popup-title">个人实名认证</span>
      <span class="popup-content">
        为了您更方便得使用我们的产品请您先进行实名认证!
      </span>
      <van-button class="popup-btn" type="primary" @click="goFaceClick"
        >立即认证</van-button
      >
    </div>
  </van-popup>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { useRouter } from 'vue-router'
export default defineComponent({
  setup() {
    const router = useRouter()
    const showPopup = ref(false)
    const contractId = ref('')
    const showPopupClick = (ID: string) => {
      contractId.value = ID
      showPopup.value = true
    }

    // 去实名
    const goFaceClick = () => {
      router.push({
        path: '/check-contract',
        query: {
          contractId: contractId.value
        }
      })
    }
    return { showPopup, showPopupClick, goFaceClick }
  }
})
</script>

<style scoped lang="less">
.face-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 194px;
  height: 240px;
  background-color: #fff;
  padding: 25px 43px;
  img {
    height: 80px;
    width: 80px;
  }
  .popup-title {
    font-size: 16px;
    color: #101010;
    font-weight: 700;
  }
  .popup-content {
    font-size: 14px;
    color: #999999;
    text-align: center;
  }
  .popup-btn {
    width: 160px;
    height: 40px;
    font-size: 16px;
  }
}
</style>
